<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<link rel="stylesheet" href="layui/css/layui.css" media="all">

		<script src="js/jquery.js"></script>
		<script src="layui/layui.js"></script>
		<style>
			.layui-form li {
				margin-left: 15px
			}
			
			.layui-form-item {
				margin-bottom: 0;
			}
		</style>
	</head>

	<body>
		<div class="layui-card">
			<div class="layui-card-header"><span class="layui-btn" id="drsj">导入数据</span></div>
			<div class="layui-card-body">

			</div>
		</div>
		<script>
			layui.use(['jquery', 'form', 'laydate', 'table', 'layer', 'element', 'upload'], function() {
				var $ = layui.$;
				var form = layui.form;
				var laydate = layui.laydate;
				var table = layui.table;
				var layer = layui.layer;
				var element = layui.element;
				var upload = layui.upload;
				upload.render({
					elem: '#drsj',
					url: 'importActivity',
					method: 'post',
					field: 'file',
					exts: 'xls|xlsx',
					
					before: function(obj) {
						layer.load();
					},
					done: function(res, index, upload) {
						console.log(type)
						layer.closeAll('loading');
						if(res.code == 0) {
							layer.alert(res.msg, {
								icon: 1
							}, function(index) {
								layer.close(index)
								
							})
						} else {
							layer.alert(res.msg, {
								icon: 2
							})
						}
						layer.closeAll('loading');
					},
					error: function(index, upload) {
						layer.closeAll('loading');
					}
				});
			})
		</script>
	</body>

</html>